package com.example.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;

/**
 * Created by GDC on 2018/8/19.
 */
@Component
@ConfigurationProperties(prefix = "config")
@Validated
public class ConfigBean {

    @Email
    private String name;

    @Override
    public String toString() {
        return "ConfigBean{" +
                "name='" + name + '\'' +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
